import { createRouter, createWebHashHistory } from "vue-router";

//引入页面
const Login = ()=> import('../views/Login.vue')
const UserCenter = ()=> import('../views/user-center/Index.vue')
const UserProfile = ()=> import('../views/user-center/Profile.vue')
const UserSettings = ()=> import('../views/user-center/Setting.vue')

const routeConfig = [

{
    path:'/',
    redirect: '/login'
},
{
    path:'/login',
    component:Login
},
{
    path:'/user',
    component:UserCenter,
    redirect: '/user/profile',
    children:[
        {
            path:'profile',
            component:UserProfile 
        },
        {
            path:'setting',
            component:UserSettings 
        }
    ]
}
]

const router = createRouter({
    history: createWebHashHistory(),
    routes: routeConfig
})

export default router